package by.brest.bspc.service.reporter.jasperreports;

import by.brest.bspc.reporter.jasperreports.JasperReportsCreator;
import by.brest.bspc.service.JasperReportsCreatorService;
import net.sf.jasperreports.engine.JasperPrint;
import org.springframework.beans.factory.annotation.Required;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Implements service for reporter.
 *
 * @date: 10/5/13 6:05 PM
 * @author: frehty
 */
public class JasperReportsCreatorServiceImpl implements JasperReportsCreatorService {

    private JasperReportsCreator jasperReportsCreator;

    @Resource
    @Required
    public void setJasperReportsCreator(JasperReportsCreator jasperReportsCreator) {
        this.jasperReportsCreator = jasperReportsCreator;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JasperPrint createReport(String sourceFile, Map<String, Object> parametersMap, String xlsxFile, String mongoUri) {
        return jasperReportsCreator.createReport(sourceFile, parametersMap, xlsxFile, mongoUri);
    }
}
